﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Management.Automation;
using System.Management.Automation.Host;
using System.Security;
using System.Windows.Forms;

namespace BGShell.PowerShell.Host
{
    interface IRunspaceHostUI
    {
        IRunspaceHostRawUI RawUI { get; }

        Dictionary<String, PSObject> Prompt(String caption, String message, Collection<FieldDescription> descriptions);
        Int32 PromptForChoice(String caption, String message, Collection<ChoiceDescription> choices, Int32 defaultChoice);
        
        PSCredential PromptForCredential(String caption, String message, String userName, String targetName, PSCredentialTypes allowedCredentialTypes, PSCredentialUIOptions options);
        PSCredential PromptForCredential(String caption, String message, String userName, String targetName);
        
        String ReadLine();
        SecureString ReadLineAsSecureString();

        void SetState(RunspaceHostState state);

        void RegisterHookKeys(IEnumerable<Keys> keys);
        void UnregisterHookKeys(IEnumerable<Keys> keys);

        void Write(ConsoleColor foregroundColor, ConsoleColor backgroundColor, String value);
        void Write(String value);

        void WriteDebugLine(String message);
        void WriteErrorLine(String value);
        void WriteLine(String value);
        void WriteProgress(Int64 sourceId, ProgressRecord record);
        void WritePrompt(String prompt);
        void WriteVerboseLine(String message);
        void WriteWarningLine(String message);
    }
}
